import type { Base, Page } from "@/api/types";
import { http } from "@/utils/http";

export type WorkId = Base & {
  name?: string;
  prefix?: string;
  suffix?: string;
  begin?: number;
  current?: number;
  next?: number;
  description?: string;
  status?: boolean;
};

export const previewWorkId = (id: string) => {
  return http.request<string>("get", `/workId/${id}`);
};
export const getWorkIdList = (params?: WorkId) => {
  return http.request<Page<WorkId>>("get", "/workId", params);
};
export const addWorkId = (params?: WorkId) => {
  return http.request<boolean>("post", "/workId", params);
};
export const updateWorkId = (params?: WorkId) => {
  return http.request<boolean>("put", "/workId", params);
};
export const deleteWorkId = (id?: string) => {
  return http.request<boolean>("delete", "/workId", { id: id });
};
